/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pl.cezary.butler.walili.server.db.tasks;

import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import pl.cezary.butler.walili.server.db.tables.ZadReszta;

/**
 *
 * @author czarek
 */
public class FixMimeTypesTasks extends UpdateTask {
    private static final Logger log = Logger.getLogger(FixMimeTypesTasks.class.getName());

    @Override
    public void execute() throws SQLException {
        final int count = getJdbcTemplate().update(String.format("UPDATE %s SET %2$s = null WHERE %2$s LIKE ?", ZadReszta.cel.getTable(),ZadReszta.mime_type),"%://%");
        if(count>0)log.log(Level.WARNING, "{0} tasks had improper mime types",count);
    }
    
}
